package com.chengshi.shop.util;

import org.springframework.context.EnvironmentAware;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;


/***
 * 读取系统配置文件
 * @author xuxinlong
 *
 */
@Configuration
public class ConfigureUtil implements EnvironmentAware {
	private static Environment environment;

	/**
	 * 获取配置信息
	 * @param key
	 * @return
	 */
	public static String config(String key) {
		return environment.getProperty(key);
	}

    @Override
    public void setEnvironment(Environment environment) {
        ConfigureUtil.environment = environment;
    }
}
